<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Global</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Global</h1>

    




<section>

<header>
    
        <h2></h2>
        
    
</header>

<article>
    <div class="container-overview">
    
        

        


<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>


        
    
    </div>

    

    

    

    

    

    

    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    
    <h4 class="name" id="armor"><span class="type-signature"></span>armor<span class="signature">(messageType, body, partIndex<span class="signature-attributes">opt</span>, partTotal<span class="signature-attributes">opt</span>, customComment<span class="signature-attributes">opt</span>, emitChecksum<span class="signature-attributes">opt</span>, config<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {String|ReadableStream.&lt;String>}</span></h4>
    

    



<div class="description">
    <p>Armor an OpenPGP binary packet block</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>messageType</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="module-enums.html#.armor">module:enums.armor</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>Type of the message</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>body</code></td>
            

            <td class="type">
            
                
<span class="param-type">Uint8Array</span>
|

<span class="param-type">ReadableStream.&lt;Uint8Array></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>The message body to armor</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>partIndex</code></td>
            

            <td class="type">
            
                
<span class="param-type">Integer</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>partTotal</code></td>
            

            <td class="type">
            
                
<span class="param-type">Integer</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>customComment</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Additional comment to add to the armored string</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>emitChecksum</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Whether to compute and include the CRC checksum
(NB: some types of data must not include it, but compliance is left as responsibility of the caller: this function does not carry out any checks)</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Full configuration, defaults to openpgp.config</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/encoding/armor.js">encoding/armor.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/encoding/armor.js#L344">line 344</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>Armored text.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">String</span>
|

<span class="param-type">ReadableStream.&lt;String></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="createCleartextMessage"><span class="type-signature">(async) </span>createCleartextMessage<span class="signature">(options)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Creates a new CleartextMessage object from text</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>text</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/cleartext.js">cleartext.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/cleartext.js#L216">line 216</a>
    </li></ul></dd>
    

    

    

    
</dl>




















        
            

    

    
    <h4 class="name" id="createMessage"><span class="type-signature">(async) </span>createMessage<span class="signature">(options)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Message.html">Message</a>>}</span></h4>
    

    



<div class="description">
    <p>Creates new message object from text or binary data.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>text</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>
|

<span class="param-type">ReadableStream.&lt;String></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>The text message contents</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>binary</code></td>
            

            <td class="type">
            
                
<span class="param-type">Uint8Array</span>
|

<span class="param-type">ReadableStream.&lt;Uint8Array></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>The binary message contents</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>filename</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    ""
                
                </td>
            

            <td class="description last"><p>Name of the file (if any)</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>date</code></td>
            

            <td class="type">
            
                
<span class="param-type">Date</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    current date
                
                </td>
            

            <td class="description last"><p>Date of the message, or modification date of the file</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>format</code></td>
            

            <td class="type">
            
                
<span class="param-type">'utf8'</span>
|

<span class="param-type">'binary'</span>
|

<span class="param-type">'text'</span>
|

<span class="param-type">'mime'</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    'utf8' if text is passed, 'binary' otherwise
                
                </td>
            

            <td class="description last"><p>Data packet type</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/message.js">message.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/message.js#L901">line 901</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>New message object.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;<a href="Message.html">Message</a>></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="decrypt"><span class="type-signature">(async) </span>decrypt<span class="signature">(options)</span><span class="type-signature"> &rarr; {Promise.&lt;Object>}</span></h4>
    

    



<div class="description">
    <p>Decrypts a message with the user's private key, a session key or a password.
One of <code>decryptionKeys</code>, <code>sessionkeys</code> or <code>passwords</code> must be specified (passing a combination of these options is not supported).</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>message</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Message.html">Message</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>The message object with the encrypted data</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>decryptionKeys</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="PrivateKey.html">PrivateKey</a></span>
|

<span class="param-type">Array.&lt;<a href="PrivateKey.html">PrivateKey</a>></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Private keys with decrypted secret key data or session key</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>passwords</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>
|

<span class="param-type">Array.&lt;String></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Passwords to decrypt the message</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>sessionKeys</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>
|

<span class="param-type">Array.&lt;Object></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Session keys in the form: { data:Uint8Array, algorithm:String }</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>verificationKeys</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="PublicKey.html">PublicKey</a></span>
|

<span class="param-type">Array.&lt;<a href="PublicKey.html">PublicKey</a>></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Array of public keys or single key, to verify signatures</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>expectSigned</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description last"><p>If true, data decryption fails if the message is not signed with the provided publicKeys</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>format</code></td>
            

            <td class="type">
            
                
<span class="param-type">'utf8'</span>
|

<span class="param-type">'binary'</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    'utf8'
                
                </td>
            

            <td class="description last"><p>Whether to return data as a string(Stream) or Uint8Array(Stream). If 'utf8' (the default), also normalize newlines.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>signature</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Signature.html">Signature</a></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Detached signature for verification</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>date</code></td>
            

            <td class="type">
            
                
<span class="param-type">Date</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    current date
                
                </td>
            

            <td class="description last"><p>Use the given date for verification instead of the current time</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Custom configuration settings to overwrite those in <a href="module-config.html">config</a></p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/openpgp.js">openpgp.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/openpgp.js#L344">line 344</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>Object containing decrypted and verified message in the form:</p>
<pre><code>{
  data: MaybeStream&lt;String&gt;, (if format was 'utf8', the default)
  data: MaybeStream&lt;Uint8Array&gt;, (if format was 'binary')
  filename: String,
  signatures: [
    {
      keyID: module:type/keyid~KeyID,
      verified: Promise&lt;true&gt;,
      signature: Promise&lt;Signature&gt;
    }, ...
  ]
}

where `signatures` contains a separate entry for each signature packet found in the input message.
</code></pre>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;Object></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="decryptKey"><span class="type-signature">(async) </span>decryptKey<span class="signature">(options)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="PrivateKey.html">PrivateKey</a>>}</span></h4>
    

    



<div class="description">
    <p>Unlock a private key with the given passphrase.
This method does not change the original key.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>privateKey</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="PrivateKey.html">PrivateKey</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>The private key to decrypt</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>passphrase</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>
|

<span class="param-type">Array.&lt;String></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>The user's passphrase(s)</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Custom configuration settings to overwrite those in <a href="module-config.html">config</a></p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/openpgp.js">openpgp.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/openpgp.js#L182">line 182</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>The unlocked key object.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;<a href="PrivateKey.html">PrivateKey</a>></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="decryptSessionKeys"><span class="type-signature">(async) </span>decryptSessionKeys<span class="signature">(options)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;Object>>}</span></h4>
    

    



<div class="description">
    <p>Decrypt symmetric session keys using private keys or passwords (not both).
One of <code>decryptionKeys</code> or <code>passwords</code> must be specified.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>message</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Message.html">Message</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>A message object containing the encrypted session key packets</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>decryptionKeys</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="PrivateKey.html">PrivateKey</a></span>
|

<span class="param-type">Array.&lt;<a href="PrivateKey.html">PrivateKey</a>></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Private keys with decrypted secret key data</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>passwords</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>
|

<span class="param-type">Array.&lt;String></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Passwords to decrypt the session key</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>date</code></td>
            

            <td class="type">
            
                
<span class="param-type">Date</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Date to use for key verification instead of the current time</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Custom configuration settings to overwrite those in <a href="module-config.html">config</a></p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/openpgp.js">openpgp.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/openpgp.js#L603">line 603</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Throws:</h5>

        

    <div class="param-desc">
    
        <p>if no session key could be found or decrypted</p>
    
    </div>


    


<h5>Returns:</h5>

        
<div class="param-desc">
    <p>Array of decrypted session key, algorithm pairs in the form:
{ data:Uint8Array, algorithm:String }</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;Array.&lt;Object>></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="encrypt"><span class="type-signature">(async) </span>encrypt<span class="signature">(options)</span><span class="type-signature"> &rarr; {Promise.&lt;(MaybeStream.&lt;String>|MaybeStream.&lt;Uint8Array>)>}</span></h4>
    

    



<div class="description">
    <p>Encrypts a message using public keys, passwords or both at once. At least one of <code>encryptionKeys</code>, <code>passwords</code> or <code>sessionKeys</code>
must be specified. If signing keys are specified, those will be used to sign the message.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>message</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Message.html">Message</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Message to be encrypted as created by <a href="global.html#createMessage">createMessage</a></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>encryptionKeys</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="PublicKey.html">PublicKey</a></span>
|

<span class="param-type">Array.&lt;<a href="PublicKey.html">PublicKey</a>></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Array of keys or single key, used to encrypt the message</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>signingKeys</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="PrivateKey.html">PrivateKey</a></span>
|

<span class="param-type">Array.&lt;<a href="PrivateKey.html">PrivateKey</a>></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Private keys for signing. If omitted message will not be signed</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>passwords</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>
|

<span class="param-type">Array.&lt;String></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Array of passwords or a single password to encrypt the message</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>sessionKey</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Session key in the form: <code>{ data:Uint8Array, algorithm:String }</code></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>format</code></td>
            

            <td class="type">
            
                
<span class="param-type">'armored'</span>
|

<span class="param-type">'binary'</span>
|

<span class="param-type">'object'</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    'armored'
                
                </td>
            

            <td class="description last"><p>Format of the returned message</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>signature</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Signature.html">Signature</a></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>A detached signature to add to the encrypted message</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>wildcard</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description last"><p>Use a key ID of 0 instead of the public key IDs</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>signingKeyIDs</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="KeyID.html">KeyID</a></span>
|

<span class="param-type">Array.&lt;<a href="KeyID.html">KeyID</a>></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    latest-created valid signing (sub)keys
                
                </td>
            

            <td class="description last"><p>Array of key IDs to use for signing. Each <code>signingKeyIDs[i]</code> corresponds to <code>signingKeys[i]</code></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>encryptionKeyIDs</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="KeyID.html">KeyID</a></span>
|

<span class="param-type">Array.&lt;<a href="KeyID.html">KeyID</a>></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    latest-created valid encryption (sub)keys
                
                </td>
            

            <td class="description last"><p>Array of key IDs to use for encryption. Each <code>encryptionKeyIDs[i]</code> corresponds to <code>encryptionKeys[i]</code></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>date</code></td>
            

            <td class="type">
            
                
<span class="param-type">Date</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    current date
                
                </td>
            

            <td class="description last"><p>Override the creation date of the message signature</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>signingUserIDs</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>
|

<span class="param-type">Array.&lt;Object></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    primary user IDs
                
                </td>
            

            <td class="description last"><p>Array of user IDs to sign with, one per key in <code>signingKeys</code>, e.g. <code>[{ name: 'Steve Sender', email: 'steve@openpgp.org' }]</code></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>encryptionUserIDs</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>
|

<span class="param-type">Array.&lt;Object></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    primary user IDs
                
                </td>
            

            <td class="description last"><p>Array of user IDs to encrypt for, one per key in <code>encryptionKeys</code>, e.g. <code>[{ name: 'Robert Receiver', email: 'robert@openpgp.org' }]</code></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>signatureNotations</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>
|

<span class="param-type">Array.&lt;Object></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    []
                
                </td>
            

            <td class="description last"><p>Array of notations to add to the signatures, e.g. <code>[{ name: 'test@example.org', value: new TextEncoder().encode('test'), humanReadable: true, critical: false }]</code></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Custom configuration settings to overwrite those in <a href="module-config.html">config</a></p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/openpgp.js">openpgp.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/openpgp.js#L275">line 275</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>Encrypted message (string if <code>armor</code> was true, the default; Uint8Array if <code>armor</code> was false).</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;(MaybeStream.&lt;String>|MaybeStream.&lt;Uint8Array>)></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="encryptKey"><span class="type-signature">(async) </span>encryptKey<span class="signature">(options)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="PrivateKey.html">PrivateKey</a>>}</span></h4>
    

    



<div class="description">
    <p>Lock a private key with the given passphrase.
This method does not change the original key.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>privateKey</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="PrivateKey.html">PrivateKey</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>The private key to encrypt</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>passphrase</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>
|

<span class="param-type">Array.&lt;String></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>If multiple passphrases, they should be in the same order as the packets each should encrypt</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Custom configuration settings to overwrite those in <a href="module-config.html">config</a></p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/openpgp.js">openpgp.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/openpgp.js#L216">line 216</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>The locked key object.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;<a href="PrivateKey.html">PrivateKey</a>></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="encryptSessionKey"><span class="type-signature">(async) </span>encryptSessionKey<span class="signature">(options)</span><span class="type-signature"> &rarr; {Promise.&lt;(String|Uint8Array)>}</span></h4>
    

    



<div class="description">
    <p>Encrypt a symmetric session key with public keys, passwords, or both at once.
At least one of <code>encryptionKeys</code> or <code>passwords</code> must be specified.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>data</code></td>
            

            <td class="type">
            
                
<span class="param-type">Uint8Array</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>The session key to be encrypted e.g. 16 random bytes (for aes128)</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>algorithm</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Algorithm of the symmetric session key e.g. 'aes128' or 'aes256'</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>aeadAlgorithm</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>AEAD algorithm, e.g. 'eax' or 'ocb'</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>encryptionKeys</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="PublicKey.html">PublicKey</a></span>
|

<span class="param-type">Array.&lt;<a href="PublicKey.html">PublicKey</a>></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Array of public keys or single key, used to encrypt the key</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>passwords</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>
|

<span class="param-type">Array.&lt;String></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Passwords for the message</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>format</code></td>
            

            <td class="type">
            
                
<span class="param-type">'armored'</span>
|

<span class="param-type">'binary'</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    'armored'
                
                </td>
            

            <td class="description last"><p>Format of the returned value</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>wildcard</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description last"><p>Use a key ID of 0 instead of the public key IDs</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>encryptionKeyIDs</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="KeyID.html">KeyID</a></span>
|

<span class="param-type">Array.&lt;<a href="KeyID.html">KeyID</a>></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    latest-created valid encryption (sub)keys
                
                </td>
            

            <td class="description last"><p>Array of key IDs to use for encryption. Each encryptionKeyIDs[i] corresponds to encryptionKeys[i]</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>date</code></td>
            

            <td class="type">
            
                
<span class="param-type">Date</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    current date
                
                </td>
            

            <td class="description last"><p>Override the date</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>encryptionUserIDs</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>
|

<span class="param-type">Array.&lt;Object></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    primary user IDs
                
                </td>
            

            <td class="description last"><p>Array of user IDs to encrypt for, one per key in <code>encryptionKeys</code>, e.g. <code>[{ name: 'Phil Zimmermann', email: 'phil@openpgp.org' }]</code></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Custom configuration settings to overwrite those in <a href="module-config.html">config</a></p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/openpgp.js">openpgp.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/openpgp.js#L569">line 569</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>Encrypted session keys (string if <code>armor</code> was true, the default; Uint8Array if <code>armor</code> was false).</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;(String|Uint8Array)></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="generateKey"><span class="type-signature">(async) </span>generateKey<span class="signature">(options)</span><span class="type-signature"> &rarr; {Promise.&lt;Object>}</span></h4>
    

    



<div class="description">
    <p>Generates a new OpenPGP key pair. Supports RSA and ECC keys, as well as the newer Curve448 and Curve25519 keys.
By default, primary and subkeys will be of same type.
The generated primary key will have signing capabilities. By default, one subkey with encryption capabilities is also generated.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>userIDs</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>
|

<span class="param-type">Array.&lt;Object></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>User IDs as objects: <code>{ name: 'Jo Doe', email: 'info@jo.com' }</code></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>type</code></td>
            

            <td class="type">
            
                
<span class="param-type">'ecc'</span>
|

<span class="param-type">'rsa'</span>
|

<span class="param-type">'curve448'</span>
|

<span class="param-type">'curve25519'</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    'ecc'
                
                </td>
            

            <td class="description last"><p>The primary key algorithm type: ECC (default for v4 keys), RSA, Curve448 or Curve25519 (new format, default for v6 keys).
Note: Curve448 and Curve25519 (new format) are not widely supported yet.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>passphrase</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    (not protected)
                
                </td>
            

            <td class="description last"><p>The passphrase used to encrypt the generated private key. If omitted or empty, the key won't be encrypted.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>rsaBits</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    4096
                
                </td>
            

            <td class="description last"><p>Number of bits for RSA keys</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>curve</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    'curve25519Legacy'
                
                </td>
            

            <td class="description last"><p>Elliptic curve for ECC keys:
curve25519Legacy (default), nistP256, nistP384, nistP521, secp256k1,
brainpoolP256r1, brainpoolP384r1, or brainpoolP512r1</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>date</code></td>
            

            <td class="type">
            
                
<span class="param-type">Date</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    current date
                
                </td>
            

            <td class="description last"><p>Override the creation date of the key and the key signatures</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>keyExpirationTime</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    0 (never expires)
                
                </td>
            

            <td class="description last"><p>Number of seconds from the key creation time after which the key expires</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>subkeys</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;Object></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    a single encryption subkey
                
                </td>
            

            <td class="description last"><p>Options for each subkey e.g. <code>[{sign: true, passphrase: '123'}]</code>
default to main key options, except for <code>sign</code> parameter that defaults to false, and indicates whether the subkey should sign rather than encrypt</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>format</code></td>
            

            <td class="type">
            
                
<span class="param-type">'armored'</span>
|

<span class="param-type">'binary'</span>
|

<span class="param-type">'object'</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    'armored'
                
                </td>
            

            <td class="description last"><p>format of the output keys</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Custom configuration settings to overwrite those in <a href="module-config.html">config</a></p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/openpgp.js">openpgp.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/openpgp.js#L59">line 59</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>The generated key object in the form:
{ privateKey:PrivateKey|Uint8Array|String, publicKey:PublicKey|Uint8Array|String, revocationCertificate:String }</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;Object></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="generateSessionKey"><span class="type-signature">(async) </span>generateSessionKey<span class="signature">(options)</span><span class="type-signature"> &rarr; {Promise.&lt;{data: Uint8Array, algorithm: String}>}</span></h4>
    

    



<div class="description">
    <p>Generate a new session key object, taking the algorithm preferences of the passed public keys into account, if any.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>encryptionKeys</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="PublicKey.html">PublicKey</a></span>
|

<span class="param-type">Array.&lt;<a href="PublicKey.html">PublicKey</a>></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Array of public keys or single key used to select algorithm preferences for. If no keys are given, the algorithm will be <a href="module-config.html#.preferredSymmetricAlgorithm">config.preferredSymmetricAlgorithm</a></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>date</code></td>
            

            <td class="type">
            
                
<span class="param-type">Date</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    current date
                
                </td>
            

            <td class="description last"><p>Date to select algorithm preferences at</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>encryptionUserIDs</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>
|

<span class="param-type">Array.&lt;Object></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    primary user IDs
                
                </td>
            

            <td class="description last"><p>User IDs to select algorithm preferences for</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Custom configuration settings to overwrite those in <a href="module-config.html">config</a></p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/openpgp.js">openpgp.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/openpgp.js#L536">line 536</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>Object with session key data and algorithm.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;{data: Uint8Array, algorithm: String}></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="readCleartextMessage"><span class="type-signature">(async) </span>readCleartextMessage<span class="signature">(options)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="CleartextMessage.html">CleartextMessage</a>>}</span></h4>
    

    



<div class="description">
    <p>Reads an OpenPGP cleartext signed message and returns a CleartextMessage object</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>cleartextMessage</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>Text to be parsed</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Custom configuration settings to overwrite those in <a href="module-config.html">config</a></p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/cleartext.js">cleartext.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/cleartext.js#L145">line 145</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>New cleartext message object.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;<a href="CleartextMessage.html">CleartextMessage</a>></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="readMessage"><span class="type-signature">(async) </span>readMessage<span class="signature">(options)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Message.html">Message</a>>}</span></h4>
    

    



<div class="description">
    <p>Reads an (optionally armored) OpenPGP message and returns a Message object</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>armoredMessage</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>
|

<span class="param-type">ReadableStream.&lt;String></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Armored message to be parsed</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>binaryMessage</code></td>
            

            <td class="type">
            
                
<span class="param-type">Uint8Array</span>
|

<span class="param-type">ReadableStream.&lt;Uint8Array></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Binary to be parsed</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Custom configuration settings to overwrite those in <a href="module-config.html">config</a></p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/message.js">message.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/message.js#L860">line 860</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>New message object.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;<a href="Message.html">Message</a>></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="readSignature"><span class="type-signature">(async) </span>readSignature<span class="signature">(options)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Signature.html">Signature</a>>}</span></h4>
    

    



<div class="description">
    <p>reads an (optionally armored) OpenPGP signature and returns a signature object</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>armoredSignature</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Armored signature to be parsed</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>binarySignature</code></td>
            

            <td class="type">
            
                
<span class="param-type">Uint8Array</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Binary signature to be parsed</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Custom configuration settings to overwrite those in <a href="module-config.html">config</a></p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/signature.js">signature.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/signature.js#L77">line 77</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>New signature object.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;<a href="Signature.html">Signature</a>></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="reformatKey"><span class="type-signature">(async) </span>reformatKey<span class="signature">(options)</span><span class="type-signature"> &rarr; {Promise.&lt;Object>}</span></h4>
    

    



<div class="description">
    <p>Reformats signature packets for a key and rewraps key object.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>privateKey</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="PrivateKey.html">PrivateKey</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Private key to reformat</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>userIDs</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>
|

<span class="param-type">Array.&lt;Object></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>User IDs as objects: <code>{ name: 'Jo Doe', email: 'info@jo.com' }</code></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>passphrase</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    (not protected)
                
                </td>
            

            <td class="description last"><p>The passphrase used to encrypt the reformatted private key. If omitted or empty, the key won't be encrypted.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>keyExpirationTime</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    0 (never expires)
                
                </td>
            

            <td class="description last"><p>Number of seconds from the key creation time after which the key expires</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>date</code></td>
            

            <td class="type">
            
                
<span class="param-type">Date</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Override the creation date of the key signatures. If the key was previously used to sign messages, it is recommended
to set the same date as the key creation time to ensure that old message signatures will still be verifiable using the reformatted key.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>format</code></td>
            

            <td class="type">
            
                
<span class="param-type">'armored'</span>
|

<span class="param-type">'binary'</span>
|

<span class="param-type">'object'</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    'armored'
                
                </td>
            

            <td class="description last"><p>format of the output keys</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Custom configuration settings to overwrite those in <a href="module-config.html">config</a></p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/openpgp.js">openpgp.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/openpgp.js#L110">line 110</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>The generated key object in the form:
{ privateKey:PrivateKey|Uint8Array|String, publicKey:PublicKey|Uint8Array|String, revocationCertificate:String }</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;Object></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="revokeKey"><span class="type-signature">(async) </span>revokeKey<span class="signature">(options)</span><span class="type-signature"> &rarr; {Promise.&lt;Object>}</span></h4>
    

    



<div class="description">
    <p>Revokes a key. Requires either a private key or a revocation certificate.
If a revocation certificate is passed, the reasonForRevocation parameter will be ignored.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>key</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Key.html">Key</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Public or private key to revoke</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>revocationCertificate</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Revocation certificate to revoke the key with</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>reasonForRevocation</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Object indicating the reason for revocation</p>
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>flag</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="module-enums.html#.reasonForRevocation">module:enums.reasonForRevocation</a></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <a href="module-enums.html#.reasonForRevocation">noReason</a>
                
                </td>
            

            <td class="description last"><p>Flag indicating the reason for revocation</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>string</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    ""
                
                </td>
            

            <td class="description last"><p>String explaining the reason for revocation</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>date</code></td>
            

            <td class="type">
            
                
<span class="param-type">Date</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Use the given date instead of the current time to verify validity of revocation certificate (if provided), or as creation time of the revocation signature</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>format</code></td>
            

            <td class="type">
            
                
<span class="param-type">'armored'</span>
|

<span class="param-type">'binary'</span>
|

<span class="param-type">'object'</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    'armored'
                
                </td>
            

            <td class="description last"><p>format of the output key(s)</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Custom configuration settings to overwrite those in <a href="module-config.html">config</a></p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/openpgp.js">openpgp.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/openpgp.js#L151">line 151</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>The revoked key in the form:
{ privateKey:PrivateKey|Uint8Array|String, publicKey:PublicKey|Uint8Array|String } if private key is passed, or
{ privateKey: null, publicKey:PublicKey|Uint8Array|String } otherwise</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;Object></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="sign"><span class="type-signature">(async) </span>sign<span class="signature">(options)</span><span class="type-signature"> &rarr; {Promise.&lt;MaybeStream.&lt;(String|Uint8Array)>>}</span></h4>
    

    



<div class="description">
    <p>Signs a message.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>message</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="CleartextMessage.html">CleartextMessage</a></span>
|

<span class="param-type"><a href="Message.html">Message</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>(cleartext) message to be signed</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>signingKeys</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="PrivateKey.html">PrivateKey</a></span>
|

<span class="param-type">Array.&lt;<a href="PrivateKey.html">PrivateKey</a>></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Array of keys or single key with decrypted secret key data to sign cleartext</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>recipientKeys</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Key.html">Key</a></span>
|

<span class="param-type">Array.&lt;<a href="Key.html">Key</a>></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Array of keys or single to get the signing preferences from</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>format</code></td>
            

            <td class="type">
            
                
<span class="param-type">'armored'</span>
|

<span class="param-type">'binary'</span>
|

<span class="param-type">'object'</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    'armored'
                
                </td>
            

            <td class="description last"><p>Format of the returned message</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>detached</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description last"><p>If the return value should contain a detached signature</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>signingKeyIDs</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="KeyID.html">KeyID</a></span>
|

<span class="param-type">Array.&lt;<a href="KeyID.html">KeyID</a>></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    latest-created valid signing (sub)keys
                
                </td>
            

            <td class="description last"><p>Array of key IDs to use for signing. Each signingKeyIDs[i] corresponds to signingKeys[i]</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>date</code></td>
            

            <td class="type">
            
                
<span class="param-type">Date</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    current date
                
                </td>
            

            <td class="description last"><p>Override the creation date of the signature</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>signingUserIDs</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>
|

<span class="param-type">Array.&lt;Object></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    primary user IDs
                
                </td>
            

            <td class="description last"><p>Array of user IDs to sign with, one per key in <code>signingKeys</code>, e.g. <code>[{ name: 'Steve Sender', email: 'steve@openpgp.org' }]</code></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>recipientUserIDs</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>
|

<span class="param-type">Array.&lt;Object></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    primary user IDs
                
                </td>
            

            <td class="description last"><p>Array of user IDs to get the signing preferences from, one per key in <code>recipientKeys</code></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>signatureNotations</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>
|

<span class="param-type">Array.&lt;Object></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    []
                
                </td>
            

            <td class="description last"><p>Array of notations to add to the signatures, e.g. <code>[{ name: 'test@example.org', value: new TextEncoder().encode('test'), humanReadable: true, critical: false }]</code></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Custom configuration settings to overwrite those in <a href="module-config.html">config</a></p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/openpgp.js">openpgp.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/openpgp.js#L410">line 410</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>Signed message (string if <code>armor</code> was true, the default; Uint8Array if <code>armor</code> was false).</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;MaybeStream.&lt;(String|Uint8Array)>></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="unarmor"><span class="type-signature">(async) </span>unarmor<span class="signature">(input)</span><span class="type-signature"> &rarr; {Promise.&lt;Object>}</span></h4>
    

    



<div class="description">
    <p>Dearmor an OpenPGP armored message; verify the checksum and return
the encoded bytes</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>input</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last"><p>OpenPGP armored message</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/encoding/armor.js">encoding/armor.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/encoding/armor.js#L231">line 231</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>An object with attribute &quot;text&quot; containing the message text,
an attribute &quot;data&quot; containing a stream of bytes and &quot;type&quot; for the ASCII armor type</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;Object></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="verify"><span class="type-signature">(async) </span>verify<span class="signature">(options)</span><span class="type-signature"> &rarr; {Promise.&lt;Object>}</span></h4>
    

    



<div class="description">
    <p>Verifies signatures of cleartext signed message</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>message</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="CleartextMessage.html">CleartextMessage</a></span>
|

<span class="param-type"><a href="Message.html">Message</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>(cleartext) message object with signatures</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>verificationKeys</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="PublicKey.html">PublicKey</a></span>
|

<span class="param-type">Array.&lt;<a href="PublicKey.html">PublicKey</a>></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Array of publicKeys or single key, to verify signatures</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>expectSigned</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description last"><p>If true, verification throws if the message is not signed with the provided publicKeys</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>format</code></td>
            

            <td class="type">
            
                
<span class="param-type">'utf8'</span>
|

<span class="param-type">'binary'</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    'utf8'
                
                </td>
            

            <td class="description last"><p>Whether to return data as a string(Stream) or Uint8Array(Stream). If 'utf8' (the default), also normalize newlines.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>signature</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Signature.html">Signature</a></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Detached signature for verification</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>date</code></td>
            

            <td class="type">
            
                
<span class="param-type">Date</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    current date
                
                </td>
            

            <td class="description last"><p>Use the given date for verification instead of the current time</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Custom configuration settings to overwrite those in <a href="module-config.html">config</a></p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/openpgp.js">openpgp.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/openpgp.js#L479">line 479</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>Object containing verified message in the form:</p>
<pre><code>{
  data: MaybeStream&lt;String&gt;, (if `message` was a CleartextMessage)
  data: MaybeStream&lt;Uint8Array&gt;, (if `message` was a Message)
  signatures: [
    {
      keyID: module:type/keyid~KeyID,
      verified: Promise&lt;true&gt;,
      signature: Promise&lt;Signature&gt;
    }, ...
  ]
}

where `signatures` contains a separate entry for each signature packet found in the input message.
</code></pre>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;Object></span>


    </dd>
</dl>

    





        
    

    

    
</article>

</section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Functions</h3><ul><li><a href="global.html#armor">armor</a></li><li><a href="global.html#createCleartextMessage">createCleartextMessage</a></li><li><a href="global.html#createMessage">createMessage</a></li><li><a href="global.html#decrypt">decrypt</a></li><li><a href="global.html#decryptKey">decryptKey</a></li><li><a href="global.html#decryptSessionKeys">decryptSessionKeys</a></li><li><a href="global.html#encrypt">encrypt</a></li><li><a href="global.html#encryptKey">encryptKey</a></li><li><a href="global.html#encryptSessionKey">encryptSessionKey</a></li><li><a href="global.html#generateKey">generateKey</a></li><li><a href="global.html#generateSessionKey">generateSessionKey</a></li><li><a href="global.html#readCleartextMessage">readCleartextMessage</a></li><li><a href="global.html#readMessage">readMessage</a></li><li><a href="global.html#readSignature">readSignature</a></li><li><a href="global.html#reformatKey">reformatKey</a></li><li><a href="global.html#revokeKey">revokeKey</a></li><li><a href="global.html#sign">sign</a></li><li><a href="global.html#unarmor">unarmor</a></li><li><a href="global.html#verify">verify</a></li></ul><h3>Modules</h3><ul><li><a href="module-config.html">config</a></li><li><a href="module-enums.html">enums</a></li></ul><h3>Classes</h3><ul><li><a href="AEADEncryptedDataPacket.html">AEADEncryptedDataPacket</a></li><li><a href="CleartextMessage.html">CleartextMessage</a></li><li><a href="CompressedDataPacket.html">CompressedDataPacket</a></li><li><a href="Key.html">Key</a></li><li><a href="LiteralDataPacket.html">LiteralDataPacket</a></li><li><a href="MarkerPacket.html">MarkerPacket</a></li><li><a href="Message.html">Message</a></li><li><a href="OnePassSignaturePacket.html">OnePassSignaturePacket</a></li><li><a href="PacketList.html">PacketList</a></li><li><a href="PaddingPacket.html">PaddingPacket</a></li><li><a href="PrivateKey.html">PrivateKey</a></li><li><a href="PublicKey.html">PublicKey</a></li><li><a href="PublicKeyEncryptedSessionKeyPacket.html">PublicKeyEncryptedSessionKeyPacket</a></li><li><a href="PublicKeyPacket.html">PublicKeyPacket</a></li><li><a href="PublicSubkeyPacket.html">PublicSubkeyPacket</a></li><li><a href="SecretKeyPacket.html">SecretKeyPacket</a></li><li><a href="SecretSubkeyPacket.html">SecretSubkeyPacket</a></li><li><a href="Signature.html">Signature</a></li><li><a href="SignaturePacket.html">SignaturePacket</a></li><li><a href="SymEncryptedIntegrityProtectedDataPacket.html">SymEncryptedIntegrityProtectedDataPacket</a></li><li><a href="SymEncryptedSessionKeyPacket.html">SymEncryptedSessionKeyPacket</a></li><li><a href="SymmetricallyEncryptedDataPacket.html">SymmetricallyEncryptedDataPacket</a></li><li><a href="TrustPacket.html">TrustPacket</a></li><li><a href="UserAttributePacket.html">UserAttributePacket</a></li><li><a href="UserIDPacket.html">UserIDPacket</a></li><li><a href="module-key_Subkey-Subkey.html">Subkey</a></li><li><a href="module-key_User-User.html">User</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a>
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>